package com.pp.controller;

import com.pp.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @Autowired
    private User  user;

    @Value("${name}")
    private String name;

    @RequestMapping("/hello")
    @ResponseBody
    public String Hello(){
        return "hello";
    }

    @RequestMapping("/hello2")
    @ResponseBody
    public User Hello2(){

//        user.setName("zs");
//        user.setAge(22);
        return user;
    }


    @RequestMapping("/hello3")
    @ResponseBody
    public String Hello3(){


        return name;
    }


}
